package com.horizon.common.exception;

import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * HorizonException通用处理器.
 *
 * @author zhaoshb
 * @since 2023/1/15 20:46
 */
@Component
public class HorizonExceptionHandler {

    @ExceptionHandler(HorizonException.class)
    public R<Object> handleException(HorizonException e) {
        return R.fail(e.getResultCode());
    }
}
